<?php get_header(); ?>
<div id="leftbox">
            <?php if($bakla): ?>
			<?php $bakla->tarih = explode(" ",$bakla->tarih); ?>
			<?php $answer = ($bakla->cozulme_durumu == 0 ? "" : "_answered"); ?>
                <div class="bean_item">
                	<div class="left">
                    	<div class="answer_count<?php echo $answer; ?>"><div class="count"><?php echo $bakla->cevap_sayisi; ?></div><div class="text">cevap</div></div>
                        <div class="answer_button<?php echo $answer; ?>"><a href="#">cevapla!</a></div>
                    </div>
                	<div class="right">
                    	<div class="title<?php echo $answer; ?>"><a href="<?php echo bakla_url($bakla->slug); ?>"><?php echo $bakla->baslik; ?></a></div>
                    	<div class="info<?php echo $answer; ?>"><a href="#"><?php echo iddenKadi($bakla->uye_id); ?></a> tarafından <span><?php echo $bakla->tarih[0]; ?></span> tarihinde <span><?php echo $bakla->tarih[1]; ?></span> sularında yazılmış.</div>
                        <div class="content">
                        	<?php echo $bakla->icerik; ?>
                        </div>
                        <?php if(uye_girdi()): ?>
                        <div class="links">
                        	<a href="#"><img src="<?php echo base_url(); ?>media/images/share<?php echo $answer; ?>.jpg" /></a>
                            <a href="#"><img src="<?php echo base_url(); ?>media/images/follow<?php echo $answer; ?>.jpg" /></a>
                        </div>
                        <?php endif; ?>
                    </div>
                    <div class="clearer"></div>
                </div>
			<?php else: ?>
				<div class="error">Bakla görüntülenirken bir sorun meydana geldi.</div>
			<?php endif; ?>
                <div class="seperator"></div>
				<div id="comments_area">
						<h2>Cevaplar (<?php echo $bakla->cevap_sayisi; ?>)</h2>
						<?php if($cevaplar):?>
						<div id="comments">
							<?php foreach($cevaplar as $cevap): ?>
							<script>
							var refreshId = setInterval(function()
							{
							     $('.autotime').fadeOut("slow").load('<?php echo cevap_url($cevap->id) . '/zaman'; ?>').fadeIn("fast");
							}, 60000);
							</script>
							<?php $situation = ($cevap->dogru_cevap == 0 ? "" : "_true"); ?>
							<div class="item">
								<div class="left">
									<div class="avatar">
										<a href="#"><img src="<?php echo uye_bilgi("avatar", iddenKadi($cevap->uye_id)); ?>" /></a>
									</div>
								</div>
								<div class="right">
									<div class="info">
										<a href="#"><?php echo iddenKadi($cevap->uye_id); ?></a> tarafından <span><span class="autotime"><?php echo time_since(make_time($cevap->tarih)); ?></span></span> önce yazılmış.
									</div>
									<div class="text"><?php echo $cevap->icerik; ?></div>
									<?php if(uye_girdi()): ?>
									<div class="links">
										<div class="station_button"><a href="#">evet (<?php echo $cevap->dogru_sayisi; ?>)</a></div>
										<div class="station_button"><a href="#">hayır (<?php echo $cevap->yanlis_sayisi; ?>)</a></div>
										<?php if(iddenKadi($bakla->uye_id) == kullanici_adi() and $bakla->cozulme_durumu == 0): ?><div class="true_button"><a href="#">cevap!</a></div><?php endif; ?>
										<div class="clearer"></div>
									</div>
									<?php endif; ?>
								</div>
								<div class="clearer"></div>
							</div>
							<?php endforeach; ?>			
						</div>
						<?php else: ?>
							<div class="error">Bu baklaya henüz bir cevap verilmemiş. İlk cevabı vermek için <?php if(!uye_girdi()): ?><a href="<?php echo giris_url(); ?>">giriş yapın</a>.<?php else: ?> <a href="#">tıklayınız</a>.<?php endif; ?></div>
						<?php endif; ?>
				</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>